package com.demo.enums;

public enum OnlineUatTest {
	ONLINE(1, "线上环境"), UAT(2, "UAT环境"), TEST(4, "测试环境");
	private Integer code;
	private String msg;

	private OnlineUatTest() {
	}

	private OnlineUatTest(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public OnlineUatTest stateOf(Integer code) {
		for (OnlineUatTest env : OnlineUatTest.values()) {
			if (env.getCode() == code) {
				return env;
			}
		}
		return null;
	}

}
